Repository navigation
[dxgi] Add DXVK_HOTPATCHABLE to swapchain dispatcher (Round #2) - #6049
Merged
Merged
Conversation
[DreamWorks Shrek 2 Remastered](https://store.steampowered.com/app/2523740/DreamWorks_Shrek_2_Remastered/) hooks a bunch of these functions for whatever reason. Mark them all as hotpatchable so the game works on arm64ec proton. Turns out the reason why this was causing Deadlock to crash is that gcc-mingw has a bug with the `ms_hook_prologue` attribute on vtable entries. These entries end up getting offset 32 bytes forward for whatever reason. llvm-mingw and MSVC doesn't have this problem. For now add a new hotpatchable attribute type which only triggers on arm64ec/chpe platforms. I confirmed this change works with Deadlock on x86 by virtue of being a nop there, and Shrek 2 Remastered also still works on my ARM desktop. Might be worth contemplating switching over to llvm-mingw entirely.
Owner
|
One think I don't quite understand is why this only breaks the swapchain stuff, we have hotpatchable code in e.g. the DXGI factory as well. Is it code size related in any way? |
Contributor
Author
Owner
|
fun... well, changing default compiler isn't really something I want to do right now (more something for another release cycle) since it'll need a huge amount of testing, not like we haven't had fun bugs that only surfaced with LLVM builds before, so I guess this workaround will do for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

DreamWorks Shrek 2 Remastered hooks a bunch of these functions for whatever reason. Mark them all as hotpatchable so the game works on arm64ec proton.
Turns out the reason why this was causing Deadlock to crash is that gcc-mingw has a bug with the
ms_hook_prologueattribute on vtable entries. These entries end up getting offset 32 bytes forward for whatever reason. llvm-mingw and MSVC doesn't have this problem.For now add a new hotpatchable attribute type which only triggers on arm64ec/chpe platforms. I confirmed this change works with Deadlock on x86 by virtue of being a nop there, and Shrek 2 Remastered also still works on my ARM desktop.
Might be worth contemplating switching over to llvm-mingw entirely.